from os import getcwd, path
from re import sub

def is_word_palindrome(word: str) -> bool:
    return word == word[::-1]

if __name__ == "__main__":
    context = ""
    with open(path.join(getcwd(), "Q1.in"), encoding="utf-8") as f:
        for context in f.readlines():
            context = sub(r"[^a-zA-Z]", " ", context)
            context = context.split(" ")
            for word in context:
                if word != "":
                    print("{} is{}palindrome".format(word, " " if is_word_palindrome(word) else " not "))